<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:msxml="urn:schemas-microsoft-com:xslt"
	xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:Designit.VideoEmbed="urn:Designit.VideoEmbed"
	exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Designit.VideoEmbed ">


  <xsl:output method="xml" omit-xml-declaration="yes"/>
  <xsl:param name="currentPage"/>
    <xsl:variable name="videoUrl" select="/macro/videoUrl" />
    <xsl:variable name="videoHeight" select="number(/macro/videoHeight)" />
    <xsl:variable name="videoWidth" select="number(/macro/videoWidth)" />
    <xsl:variable name="openVideoInLightbox" select="boolean(number(/macro/openVideoInLightbox))" />
    <xsl:variable name="previewHeight" select="number(/macro/previewHeight)" />
    <xsl:variable name="previewWidth" select="number(/macro/previewWidth)" />
  <xsl:template match="/">
    <xsl:if test="$videoUrl != ''">
        <xsl:choose>
            <xsl:when test="$openVideoInLightbox = 'true'">
                <xsl:value-of select="Designit.VideoEmbed:VideoEmbedInLightBox($videoUrl, $videoHeight, $videoWidth, $previewHeight, $previewWidth)" disable-output-escaping="yes"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="Designit.VideoEmbed:VideoEmbed($videoUrl, $videoHeight, $videoWidth)" disable-output-escaping="yes"/>
            </xsl:otherwise>
        </xsl:choose>
        
    </xsl:if>
  </xsl:template>

</xsl:stylesheet>